﻿@using Topro.Entity.Enum;
@{
    Layout = "~/Views/Shared/_Dialog.cshtml";
}
@model Topro.Entity.Response.IQS.IQSResponse
<section class="container-fluid" style="background-color: white;">
    <form class="form-horizontal m15_t" id="form">
        <div class="tab-content">
            <input type="hidden" id="Id" name="Id" value="@(Model.Id)">
            <div class="tab-pane fade in active" id="home">
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>员工号：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="staffNum" maxlength="10"  autocomplete="off" placeholder="员工号">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>班次：</label>
                    <div class="wd250 m15_l">
                        <select name="shiftNum" class="form-control">
                            <option value="0">选择班次</option>
                            @{
                                foreach (var item in ViewBag.ShiftNum)
                                {
                                    if (item.Key == Model.ShiftNum)
                                    {
                                        <option value="@(item.Key)" selected>@(item.Value)</option>
                                    }
                                    else
                                    {
                                        <option value="@(item.Key)">@(item.Value)</option>
                                    }
                                }
                            }
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>板数：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="panelQuan" maxlength="40" value="@(Model.PanelQuan)" autocomplete="off" placeholder="板数">
                    </div>
                </div>
            </div>
        </div>
    </form>
</section>
@section footerScript{
    <script type="text/javascript">

        function save() {

            var cover = Topro.UI.Mask({
                obj: $("body"),
                opacity: 0.5
            });

            var data = $("#form").serializeJSON();

            //data.merchantId = $("select[name='merchantId']").find("option:selected").val();

            Topro.Util.Ajax({
                type: "POST",
                url: "/IQS/SaveIQS",
                data: data,
                success: function (res) {
                    if (res.success) {
                        cover.Remove();
                        Topro.UI.DialogOpener().Tip_success("操作成功！");
                        Topro.UI.DialogOpener().doSearch();
                        Topro.UI.CloseDialog();
                    } else {
                        cover.Remove();
                        Topro.UI.Tip_short_warning("操作失败！" + res.message);
                    }
                },
                error: function (json) {
                    cover.Remove();
                    Topro.UI.Tip_warning("操作失败！请查看网络，请重试。");
                }
            });

        }
    </script>
}